package service

import dao._
import implicits.Implicits._
import javax.inject.Inject
import tool.Pojo.AdvancedFilterData

import scala.concurrent.ExecutionContext.Implicits.global


/**
 * Created by yz on 4/6/2020
 */
class QueryJunctionService @Inject()(junctionDao: JunctionDao)(
  implicit val queryJunctionDao: QueryJunctionDao,
  implicit val queryFsJunctionDao: QueryFsJunctionDao,
  implicit val queryLsJunctionDao: QueryLsJunctionDao,
) {

  def selectAllGeneSymbols = {
    queryJunctionDao.selectAllGeneSymbol.zip(queryFsJunctionDao.selectAllGeneSymbol).zip(queryLsJunctionDao.
      selectAllGeneSymbol).map { case ((bsGeneSymbols, fsGeneSymbolTs), lsGeneSymbols) =>
      val fsGeneSymbol1s = fsGeneSymbolTs.map(_._1)
      val fsGeneSymbol2s = fsGeneSymbolTs.map(_._2)
      (bsGeneSymbols ::: fsGeneSymbol1s ::: fsGeneSymbol2s ::: lsGeneSymbols).distinct
    }
  }

}
